module AutoComplete
  module ViewHelper
    def auto_complete(id, array)
      output = []
      output << "<div class='auto_complete', id='#{id}_auto_complete'></div>"
      output << javascript_tag("new Autocompleter.Local('" + id + "', '" + id + "_auto_complete', "+ array + ")")
      output * "\n"
    end
  end
end